import 'dart:convert';

// {
// "id": "1acf9",
// "companyId": "西安交大第一附属医院",
// "officeId": "心内科",
// "level": "主任医师",
// "name": "马爱群",
// "phone": "",
// "photo": "/2022/09/05/45ff8055-1fae-4d33-aa3f-88012af23dd0.png"
// }
class QADoctor {
  String id = "";
  String companyId = "";
  String officeId = "";
  String level = "";
  String name = "";
  String phone = "";
  String photo = "";

  QADoctor({
    required this.id,
    required this.companyId,
    required this.officeId,
    required this.level,
    required this.name,
    required this.phone,
    required this.photo,
  });

  factory QADoctor.fromJson(Map<String, dynamic> data) {
    return QADoctor(
      id: data["id"],
      companyId: data["companyId"] ?? "",
      officeId: data["officeId"] ?? "",
      level: data["level"] ?? "",
      name: data["name"] ?? "",
      phone: data["phone"] ?? "",
      photo: data["photo"] ?? "",
    );
  }

  Map<String, dynamic> toMap() {
    return {
      'id': id,
      'companyId': companyId,
      'officeId': officeId,
      'level': level,
      'name': name,
      'phone': phone,
      'photo': photo,
    };
  }

  @override
  String toString() {
    return json.encode(toMap());
  }
}
